package com.rp.configure.mapper;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.rp.configure.entity.DeviceAttribute;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.rp.configure.entity.vo.DeviceAttributeVo;
import com.rp.configure.entity.vo.SvgDevice;
import com.rp.configure.entity.vo.SvgVo;
import com.sun.org.apache.xpath.internal.objects.XObject;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author vicente
 * @since 2021-07-16
 */
@Mapper
@Component
public interface DeviceAttributeMapper extends BaseMapper<DeviceAttribute> {


    List<DeviceAttributeVo> getListByMessage(@Param("gatewayId") String gatewayId, @Param("code")int code, @Param("slaveAddress")int slaveAddress);

    IPage<DeviceAttribute> listPage(Page<DeviceAttribute> objectPage, @Param("deviceId")String deviceId);

    IPage<DeviceAttribute> listState(Page<DeviceAttribute> page, String userId, String subjectId);
    List<DeviceAttribute> getListByDeviceId(@Param("deviceId") String deviceId);

    List<SvgVo> getStateBySubject(@Param("subjectId") String id);

    SvgDevice getBySubject(@Param("subjectId")String subjectId,@Param("svgId") String svgId);
    SvgVo getOneState(@Param("id")String id);
}
